---
title: Security(加密)
sidebar_position: 6
---

# Security

:::note
简单实现了 Aes 加解密
:::

```csharp
var msg = "123123123";
var en = AESTool.Encrypt(msg);
var de = AESTool.Decrypt(en)

en = AESTool.Encrypt(msg, "123123123123");
de = AESTool.Decrypt(en, "123123123123")

en = msg.AesEn();
de = msg.AesDe();

en = msg.AesEn("123123123123");
de = msg.AesDe("123123123123");
// de == msg
```

:::tip
同时还有 MD5 sha256 sha1 都是类似的用法
:::

```csharp
var msg = "123123123";
msg.Md5En();
msg.Sha1En();
msg.Sha256En();
```